Optional Expressions

A regular expression immediately followed by a question mark ( ? ) makes the expression optional. For example

A?

matches 0 or 1 occurrence of the letter 'A'.

See Also